{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
}}

{{#if @componentName}}
  {{component @componentName item=@item}}
{{else if @linkParams}}
  <LinkedBlock
    @params={{@linkParams}}
    @queryParams={{@queryParams}}
    @linkPrefix={{@linkPrefix}}
    class="list-item-row"
    data-test-list-item-link
  >
    <div class="level is-mobile">
      <div class="level-left is-flex-grow-1" data-test-list-item-content>
        <LinkTo
          @route={{this.link.route}}
          @models={{this.link.models}}
          class="has-text-weight-semibold has-text-black is-display-flex is-flex-grow-1 is-no-underline"
        >
          {{yield (hash content=(component "list-item/content"))}}
        </LinkTo>
      </div>
      <div class="level-right">
        <div class="level-item" data-test-list-item-popup>
          {{yield (hash callMethod=this.callMethod menu=(component "list-item/popup-menu" item=@item))}}
        </div>
      </div>
    </div>
  </LinkedBlock>
{{else}}
  <div class="list-item-row">
    <div class="level is-mobile">
      <div class="level-left is-flex-grow-1 has-text-weight-semibold" data-test-list-item>
        {{yield (hash content=(component "list-item/content"))}}
      </div>
      <div class="level-right">
        <div class="level-item" data-test-list-item-popup>
          {{yield (hash callMethod=this.callMethod menu=(component "list-item/popup-menu" item=@item))}}
        </div>
      </div>
    </div>
  </div>
{{/if}}